package string

//获取子字符串
//例如:	str:=SubStr("hello",1,2),返回el
func SubStr(haystack string, start, length int) string {
	haystackByte := []rune(haystack)
	n := len(haystackByte)
	if n == 0 || length == 0 {
		return ""
	}
	//左闭右开区间
	substr := string(haystackByte[start : start+length])
	return substr
}
